package com.jhx.demos.web.service.impl;

import com.jhx.demos.web.mapper.AdminMapper;
import com.jhx.demos.web.pojo.Admin;
import com.jhx.demos.web.pojo.Message;
import com.jhx.demos.web.service.adminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
import org.springframework.util.ObjectUtils;

import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class adminServiceimpl implements adminService {

    @Autowired
    private AdminMapper adminmapper;

    @Override
    public List<Admin> list() {
        return adminmapper.list();
    }

    @Override
    public void add(Admin adm) {
        adminmapper.insert(adm);
    }

    @Override
    public void delete(Integer id) {
        adminmapper.delete(id);
    }

    @Override
    public Message find(Integer id) {
        return adminmapper.name(id);
    }

    @Override
    public void update(Admin adm) {
        //管理员审核时没有设置当前时间
        adminmapper.update(adm);
    }

    @Override
    public Admin login1(Admin admin) {
        return adminmapper.login1(admin);
    }


}
